package com.movitech.mobile.cz.base.modules.activiti.service;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.movitech.mobile.cz.base.common.utils.StringUtils;
import com.movitech.mobile.cz.base.modules.activiti.dao.AProcessNodeLineConfigMapper;
import com.movitech.mobile.cz.base.modules.activiti.entity.AProcessNodeLineConfig;
import com.movitech.mobile.cz.base.modules.activiti.entity.AProcessNodeLineConfigExample;

@Service("aProcessNodeLineConfigService")
public class AProcessNodeLineConfigService {
    protected Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private AProcessNodeLineConfigMapper aProcessNodeLineConfigMapper;
	
	public AProcessNodeLineConfig selectById(String id) {
		AProcessNodeLineConfig aProcessNodeLineConfig = null;
		if(StringUtils.isNotEmpty(id)){
			aProcessNodeLineConfig = aProcessNodeLineConfigMapper.selectByPrimaryKey(id);
		}
		return aProcessNodeLineConfig;
	}
	
	/***
	 * 根据Activiti流程配置对象id，获取Activiti流程节点配置列表
	 * @param processConfigId
	 * @return
	 */
	public List<AProcessNodeLineConfig> getAProcessNodeLineConfigByProcessConfigId(String processConfigId) {
		AProcessNodeLineConfigExample filter = new AProcessNodeLineConfigExample();
		filter.createCriteria().andProcessConfigIdEqualTo(processConfigId);
		return aProcessNodeLineConfigMapper.selectByExample(filter);
	}
	

    /***
     * 保存AProcessNodeLineConfig对象
     * @param aProcessNodeLineConfig
     */
    public void saveAProcessNodeLineConfig(AProcessNodeLineConfig aProcessNodeLineConfig) {
    	aProcessNodeLineConfigMapper.insertSelective(aProcessNodeLineConfig);
    }
    
    /***
     * 更新AProcessNodeLineConfig对象
     * @param aProcessNodeLineConfig
     */
    public void updateAProcessNodeLineConfig(AProcessNodeLineConfig aProcessNodeLineConfig) {
    	aProcessNodeLineConfigMapper.updateByPrimaryKeySelective(aProcessNodeLineConfig);
    }
    
}